IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spTdoctran_Create')
	BEGIN
		PRINT 'Dropping Procedure spTdoctran_Create'
		DROP  Procedure  spTdoctran_Create
	END

GO

PRINT 'Creating Procedure spTdoctran_Create'
GO
CREATE Procedure dbo.spTdoctran_Create
	( 	  
	  @d_datetime DateTime = null, 
		@d_status varchar(50) = null, 
		@d_descrip varchar(254) = null, 
		@d_releasetype varchar(50) = null, 
		@d_releasereason varchar(500) = null, 
		@d_primaryattorney varchar(100) = null, 
		@d_secondaryattorney varchar(100) = null, 
		@d_releasedate DateTime = null, 
		@d_returndate DateTime = null, 
		@d_primaryattorneyletterreference varchar(50) = null, 
		@d_secondaryattorneyletterreference varchar(50) = null, 
		@d_trackingnumber varchar(100) = null, 
		@d_user varchar(50) = null, 
		@d_workstation varchar(50) = null, 
		@d_uniqueid uniqueidentifier
	)
AS
  /* 
    ------------------------------------------------------------------------------
    - Change History
    - --------------
    - Date          Description
    ------------------------------------------------------------------------------
    - 8/25/2007    Initial version created
    ------------------------------------------------------------------------------
  */

	-- Declare the required variables

	-- Create the required new record
	INSERT INTO Tdoctran
	  (
		d_datetime,
			d_status,
			d_descrip,
			d_releasetype,
			d_releasereason,
			d_primaryattorney,
			d_secondaryattorney,
			d_releasedate,
			d_returndate,
			d_primaryattorneyletterreference,
			d_secondaryattorneyletterreference,
			d_trackingnumber,
			d_user,
			d_workstation,
			d_uniqueid	  
	  )
	VALUES
	  (
		@d_datetime,
			@d_status,
			@d_descrip,
			@d_releasetype,
			@d_releasereason,
			@d_primaryattorney,
			@d_secondaryattorney,
			@d_releasedate,
			@d_returndate,
			@d_primaryattorneyletterreference,
			@d_secondaryattorneyletterreference,
			@d_trackingnumber,
			@d_user,
			@d_workstation,
			@d_uniqueid
	  )

	-- Handle any errors
	IF @@ERROR != 0
	BEGIN
		RAISERROR('spTdoctran_Create: Unable to Insert a new Tdoctran', 10, 1)
		RETURN
	END

	-- Return the newly created ID
	SELECT	@@IDENTITY AS 'Tdoctran_ID'

	-- Return to calling method
	RETURN 

GO
